package com.mumu.jetpackdemo;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.mumu.jetpackdemo.lifecycle.LifeActivity;
import com.mumu.jetpackdemo.livedata.DemoLiveDataActivity;
import com.mumu.jetpackdemo.navi.DemoNavigationActivity;
import com.mumu.jetpackdemo.page.DemoPagingActivity;
import com.mumu.jetpackdemo.viewmodel.DemoVIewModelActivity;

/**
 * - @Description: 业务导航主页<br/>
 * - @Author: edie<br/>
 * - @Time: 2019/3/25 下午3:25
 */
public class BillMainActivity extends AppCompatActivity implements View.OnClickListener {


    public static void startBill(Context context) {
        context.startActivity(new Intent(context, BillMainActivity.class));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bill_main);
        initView();
    }

    private void initView() {
        findViewById(R.id.life_cycles_btn).setOnClickListener(this);
        findViewById(R.id.view_model_btn).setOnClickListener(this);
        findViewById(R.id.live_data_btn).setOnClickListener(this);
        findViewById(R.id.paging_btn).setOnClickListener(this);
        findViewById(R.id.navigation_btn).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.life_cycles_btn:
                LifeActivity.startLife(this);
                break;
            case R.id.view_model_btn:
                DemoVIewModelActivity.startViewModel(this);
                break;
            case R.id.live_data_btn:
                DemoLiveDataActivity.startLiveData(this);
                break;
            case R.id.paging_btn:
                DemoPagingActivity.startPaging(this);
                break;
            case R.id.navigation_btn:
                DemoNavigationActivity.startNavigation(this);
                break;
        }
    }
}
